package 比赛.中兴捧月2022.练习;

import java.util.Scanner;

public class 亲和串 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s1=in.next();
        String s2=in.next();
        if ((s1+s1).indexOf(s2)!=-1&&s1.length()>=s2.length()){
            System.out.println("yes");
        }
        else {
            System.out.println("no");
        }
    }
}
